const AppInfo = imports.misc.appInfo;
const DND = imports.ui.dnd;
const GenericDisplay = imports.ui.genericDisplay;
+const Workspaces = imports.ui.workspaces;
const ENTERED_MENU_COLOR = new Clutter.Color();
ENTERED_MENU_COLOR.from_pixel(0x00ff0022);
id = source.appInfo.appId;
} else if (source instanceof AppDisplayItem) {
id = source.getId();
+ } else if (source instanceof Workspaces.WindowClone) {
+ let appMonitor = Shell.AppMonitor.get_default();
+ id = appMonitor.get_window_id(source.metaWindow);
+ if (id === null)
+ return false;
} else {
return false;
}
return list;
}
+/**
+ * shell_app_monitor_get_window_id
+ * @monitor: An app monitor instance
+ * @metawin: A #MetaWindow
+ *
+ * Returns: (transfer full): Desktop file id associated with window
+ */
+char *
+shell_app_monitor_get_window_id (ShellAppMonitor *monitor, MetaWindow *metawin)
+{
+ return g_hash_table_lookup (monitor->window_to_appid, metawin);
+}
+
/**
* shell_app_monitor_get_running_app_ids:
*
#include <glib-object.h>
#include <glib.h>
+#include "window.h"
+
/*
* This object provides monitoring of system application directories (.desktop files)
* and activity-based statistics about applications usage
ShellAppMonitor* shell_app_monitor_get_default(void);
+char *shell_app_monitor_get_window_id (ShellAppMonitor *monitor, MetaWindow *metawin);
+
/* Get the most popular applications for a given activity */
GSList *shell_app_monitor_get_most_used_apps (ShellAppMonitor *monitor,
int activity,